home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
003
/
dbstpo21.arc
/
DBSTRUPO.DOC
< prev
Wrap
Text File
|
1986-08-16
|
8KB
|
222 lines
DBSTRUPO.COM v 2.1
Display dBASE II and III structure of all DBF files on disk
Another Public Domain Program brought to you by
P. L. OLYMPIA, Ph.D.
Darwin Systems, Inc.
Sysop, Darwin BBS, 301-251-9206
UPDATE NOTES:
02/07/86 - DBSTRUPO version 1, first release
05/23/86 - Version 1.1
Fixed bug related to dBASE III header file fooling us
if the file came from Ashton-Tate's dCONVERT utility
05/29/86 - Complete rewrite of the program in Lattice C v 2.04
- Now lists structure of both dBASE II and dBASE III
files on disk. Program knows automatically which is
which. dBase II files will have a note "*dBASE II*" on
the header line of output.
- Output identical to dBASE III's LIST STRUCTURE command
08/16/86 - version 2.1
Corrects a bug where the program aborted with a message
'File not found' after it has processed about 20 files.
While I was at it, I shranked the code a few thousand bytes
more. If you find any more bugs, let me know and I'll try to
learn C before I program with it any more (heh, heh).
WHAT IN THE WORLD IS DBSTRUPO?
------------------------------
DBSTRUPO allows you to display the structure of all dBASE II and
dBASE III data bases on a given disk or subdirectory with a
single command invocation. It recognizes all dBASE DBF files
created by all versions of dBASE (including dB3+), all dBASE
compilers and add-on products. The structure listings may be
redirected to the printer or to a file. Redirecting the
output to a file gives you the flexibility of including the
data in your system documentation.
You don't need dBASE to run this program. In fact, most
people will run this program in DOS. However, you may also
execute the program from within dBASE via the dBASE RUN (or !)
command.
WHY DO YOU NEED IT?
-------------------
The alternative is to go to dBASE, USE <dbf> for each of your
data bases, SET ALTERNATE TO <outfile>, SET ALTE ON, then do
LIST STRU, then finally, CLOSE ALTE or QUIT. If you have dBASE II
files, you get out, then do a similar procedure. That can be a pain,
even with one DBF file.
I use this program to list the structure of all DBF's related to
a given application, then include the redirected output in the
MAIN PRG file as internal documentation. I include the same data
in the system's printed documentation. I also use the program to
do a quick check on a DBF structure without having to bother
loading either dBASE II or III.
COMMAND SYNTAX
--------------
DBSTRUPO [drive\path\ambiguous-filename] [>dosdev]
You may specify drive, path, any wildcard filenames, all of these
or none of these. How's that for taking care of everything you want?
You may redirect the output to "dosdev" which is any valid DOS
device, for example, PRN, or any file you name.
EXAMPLES
--------
1. Example 1
DBSTRUPO C:\DB\* >A:MYDOC.TXT
DBSTRUPO C:\DB\*.DBF >A:MYDOC.TXT
DBSTRUPO C:\DB\ >A:MYDOC.TXT
All the above examples will display the structure of all dBASE
DBF files on the C:\DB subdirectory and redirect the output to the file
A:MYDOC.TXT. If A:MYDOC.TXT already exists, it will be overwritten.
2. Example 2
DBSTRUPO
will display the structure of all dBASE DBF files on the
current directory to the screen only.
3. Example 3
DBSTRUPO T*.DBF >PRN
DBSTRUPO T* >PRN
All will display the structure of all dBASE DBF files whose
filenames begin with "T" on the default directory to the printer.
4. Example 4
DBSTRUPO B:
(This is your quiz. If you've been paying attention, you should know
what this command does).
SAMPLE OUTPUT
-------------
If TEST.DBF and TEST2.DBF are the only DBF files on the
subdirectory, D:\TEMP\, and you are logged into that subdirectory,
then each of the folowing commands:
DBSTRUPO
DBSTRUPO D:
DBSTRUPO D:\TEMP\
DBSTRUPO *
DBSTRUPO D:\TEMP\T
DBSTRUPO T
will produce the following output:
Structure for database : D:\TEMP\TEST.DBF
Number of data records : 0
Date of last update : 5/29/86
Field Field Name Type Width Dec
1 NAME Character 25
2 AGE Numeric 3
3 SALARY Numeric 10 2
4 BIGNUM Numeric 12 10
5 DOB Date 8
6 T_F Logical 1
7 NOTE Memo 10
** Total ** 70
Structure for database : D:\TEMP\TEST2.DBF *dBASE II*
Number of data records : 0
Date of last update : 5/29/86
Field Field Name Type Width Dec
1 NAME Character 40
2 AGE Numeric 3
3 SALARY Numeric 14 10
4 T:F Logical 1
** Total ** 59
Note that the TOTAL value is one more than the sum of the Width
column entries. The extra byte is due to the dBASE delete flag.
SOME NOTES ABOUT THE C LANGUAGE
-------------------------------
Many years ago, I started looking at C while I was working with
CP/M. I bought a bunch of compilers but never got around to really
using them, because I could do everything I wanted to do with
BASIC, PL/1, FORTRAN, dBASE, 8080 Assembler and (shudder!) COBOL.
Earlier this month, I was vacationing in Key West (Florida is my
favorite state, having gone to school in Gainesville) and promptly
got sick. Luckily, I brought with me the C Primer Plus book by Waite
and started studying the language then. Although I learned most
of my languages on my own (from IBM mainframe manuals, no less), I
can say that C is by far the hardest language for me to learn
(that could also be because my brain has deteriorated now). While I
learned PL/1 from IBM manuals in 3 days, ADA for CP/M in 2 days,
it took me about a week to get going in C.
Now people ask me what is the best way to learn C. I really don't
know, but all I did was read Waite's book, then looked at a bunch
of C programs in the public domain from my BBS. Without these PD
programs, I am sure I'd have a heck of a time. Thus, I want to
thank the following people whose programs I used to learn and
write DBSTRUPO: Ross Nelson, Tony Movson, David Purks.
DBSTRUPO.C probably is not the best example of C code. It is my
first real C program, after all. If I have the time I will clean
it up a bit and release the source code to the public domain.
Since I am still learning, I would like to request the C gurus out
there and other callers with good examples of C codes to please
send them to my BBS. For those who still program in BASIC and
others, I want to say that C is fantastic, compiles and executes
fast and produces much smaller EXE file. I leave you Anthony's Law
of Force: "Don't force it; get a larger hammer."
AND NOW A WORD FROM YOUR SPONSOR
--------------------------------
DBSTRUPO is copyrighted by me, but I am hereby releasing it to
the public domain for all NON-COMMERCIAL uses, provided: (oh, oh,
here's the hitch)
1. Both DBSTRUPO.COM and DBSTRUPO.DOC (this file) are distributed
together.
2. Neither file is altered in any way. If you want to alter files,
write your own.
3. You don't charge anything for distributing this program. I am
giving this to you for free, so you do the same.
All monetary contributions for this program are graciously
declined. If you really like me that much, buy my other programs such
as MEMOPO (dBASE Memo Field Utility for the Civilized) or send your
donation to my "Shareware" program FCPO1 (Electronic Filing Cabinet),
or send something new and useful (public domain only) to my BBS. If
you can't do any of the above, just be nice to your folks.
Peace be with you, Brother.